﻿@{
    WebSecurity.RequireAuthenticatedUser();
    Layout = "~/_SiteLayout.cshtml";
    Page.Title = "COURIER SEARCH";
    
}
<style type="text/css">
* { font-family: Verdana; font-size: 96%; }
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p { clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
</style>
<script>
    $(function(){
       wireEvents(); 
    });
    
    function wireEvents(){
    
         $("#search").click(function(){
             searchBP();
         });
        
         $("#clear").click(function(){
            clearForm("#courierSearch");
        });
    }
    
    function processKey(e)
    {
        if (null == e)
            e = window.event ;
        if (e.keyCode == 13)  {
            if(validateForm()){
                    searchCustomer();  
                }
        }
    }
    
    function searchBP(){
        /* $.ajax({
            url:"/Maintenance/Services/RefDataService/searchbp",
            async:false,
            cache:false,
            dataType:'json',
            data:data,
            success: function(data){
                 loadGrid();   
            }
            
         });*/
        loadGrid();
    }
    
    function loadGrid(){
         var formData =  $("#courierSearch").serialize();
        $("#grid").empty();
        
        
        var dummy = new Date().getTime();
        $.get("/Maintenance/SearchCourierGrid/",formData+"&date="+dummy,function(data){
            $("#grid").html(data); 
        });
    }
</script>
<form method="courierSearch" id="courierSearch">
     <div id="spinner" class="spinnerContent" >
                    <img id="img-spinner" src="@Href("/images/ajax-loader.gif")" alt="Loading"/>
                    <p>Searching customers please wait...</p>
                </div>
    <div id="spinnerBG"></div>
    <!--FORM ELEMENTS-->
    <div>
        <fieldset class="ui-widget ui-widget-content">
             <legend>Search Parameters</legend>
            <p><label for="crCode">Courier Code:</label> </p>
            <p><input type="text" name="crcode" " id="crcode"/></p>
            <p><label for="crName">Courier Name:</label> </p>
            <p><input type="text" name="cname" " id="cname"/></p>
            <p><label for="crCode">Active:</label> </p>
            <p><select name="active" id="active">
                <option value="1">Yes</option>
                <option value="0">No</option>
               
            </select>
                </p>
            
        </fieldset>
    </div>
    
    <!--END FORM-->
    
    <div id="buttons">
        <input type="button" id="search"  value="search"/>
        <input type="button" id="clear" value="clear"/>
    </div>
  <div id="grid"></div>
</form>